package com.paobuji.aidebao.myapplication.service;
import com.paobuji.aidebao.myapplication.bean.AddLookQuestionResult;
import com.paobuji.aidebao.myapplication.bean.AddQuestionResult;
import com.paobuji.aidebao.myapplication.bean.AddQuestionUsefulResult;
import com.paobuji.aidebao.myapplication.bean.AddSportHistory;
import com.paobuji.aidebao.myapplication.bean.AppVersionResult;
import com.paobuji.aidebao.myapplication.bean.GetAllQuestion;
import com.paobuji.aidebao.myapplication.bean.GetRankingList;
import com.paobuji.aidebao.myapplication.bean.GetSportHistoryList;
import com.paobuji.aidebao.myapplication.bean.SendSmsResult;
import com.paobuji.aidebao.myapplication.bean.UserBeanResult;

import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.POST;
import retrofit2.http.Query;

/**
 * Created by lenovo on 2017/3/13.
 */

public interface MyIntentService {
    //通过手机号登录
    @GET("/adbs/userbeancontrol/loginByPhone")
    Call<UserBeanResult> loginByPhone(
            @Query("userphone") String userphone,
            @Query("userpass") String userpass);

    //通过唯一标示码登录
    @GET("/adbs/userbeancontrol/loginByIdentified")
    Call<UserBeanResult> loginByIdentified(
            @Query("identified") String identified);

    //用户注册
    @GET("/adbs/userbeancontrol/registuserbeaninfo")
    Call<UserBeanResult> Regist(
            @Query("userphone") String userphone,
            @Query("userpass") String userpass,
            @Query("identified") String identified);

    //修改用户信息
    @GET("/adbs/userbeancontrol/updateuserbeaninfo")
    Call<UserBeanResult> UpdateUserInfoResult(
            @Query("id") int id,
            @Query("name") String name,
            @Query("usersex") String usersex,
            @Query("birth") String birt,
            @Query("userhobby") String userhobby,
            @Query("userImg") String userImg,
            @Query("weight") double weight,
            @Query("height") double height);

    //修改密码
    @GET("/adbs/userbeancontrol/updateuserbeanpass")
    Call<UserBeanResult> updateUserPass(
            @Query("userphone") String userphone,
            @Query("userpass") String userpass);


    //查询用户信息
    @GET("/adbs/userbeancontrol/selectUserByPhone")
    Call<UserBeanResult> selectUserByPhone(
            @Query("phone") String phone);

     /*--------------------------------------一下为运动记录相关的操作----------------------------------------*/

    //添加一条运动记录
    @GET("/adbs/sporthistory/addsporthistory")
    Call<AddSportHistory> addSportHistory(
            @Query("userId") int userId,
            @Query("sportTime") int sportTime,
            @Query("alldis") double alldis,
            @Query("allCor") double allCor);


    //运动记录的查询
    @GET("/adbs/sporthistory/getsporthitorylist")
    Call<GetSportHistoryList> getSportHitoryList(
            @Query("userId") int userId);

    //运动记录排行榜查询
    @GET("/adbs/userbeancontrol/getallrankinglist")
    Call<GetRankingList> getRankingList(
            @Query("page") int page,
            @Query("size") int size);



    /*--------------------------------------一下为问题相关的查询操作----------------------------------------*/



    //添加一个问题
    @GET("/adbs/questionControl/addquestioninfo")
    Call<AddQuestionResult> addQuestion(
            @Query("quesTitle") String quesTitle,
            @Query("quesType") String quesType,
            @Query("quesAnswer") String quesAnswer,
            @Query("keyWord") String keyWord);

    //统计某个问题的总的浏览人数
    @GET("/adbs/questionControl/addlooklquestionuser")
    Call<AddLookQuestionResult> addLookQuestionNum(
            @Query("id") int id);


    //觉得问题回答有用
    @GET("/adbs/questionControl/addquestionuseful")
    Call<AddQuestionUsefulResult> addQuestionUseful(
            @Query("id") int id);


    //查询问题，根据关键字
    @GET("/adbs/questionControl/getquestionlist")
    Call<GetAllQuestion> getAllQuestionList(
            @Query("keyWord") String keyWord,
            @Query("page") int page,
            @Query("size") int size);

    @POST("/sms.aspx")
    Call<SendSmsResult> sendSms(
            @Query("action") String action,
            @Query("account") String account,
            @Query("password") String password,
            @Query("userid") String userid,
            @Query("mobile") String mobile,
            @Query("content") String content,
            @Query("rt") String rt);

    @GET("/adbs/appversioncontrol/getappcode")
    Call<AppVersionResult> getAppVersion(
            @Query("id") int id);
}
